//
//  GWWebViewController.m
//  百思不得姐
//
//  Created by qianfeng on 16/3/8.
//  Copyright © 2016年 高炜. All rights reserved.
//

#import "GWWebViewController.h"

@interface GWWebViewController ()<UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *webView;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *back;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *forword;



@end

@implementation GWWebViewController
- (IBAction)refresh:(id)sender {
    [self.webView reload];
}
- (IBAction)back:(id)sender {
    [self.webView goBack];
}
- (IBAction)forword:(id)sender {
    [self.webView goForward];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url]]];
    self.webView.delegate =self;
}
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    self.back.enabled =webView.canGoBack;
    self.forword.enabled =webView.canGoForward;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
